/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 * interfaz
 */
package megaboletosclient;

import clases.*;
import clases.Seccion;
import java.awt.Image;
import java.awt.Point;
import java.awt.Toolkit;
import java.net.URL;
import java.util.ArrayList;
import java.util.Date;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.AbstractTableModel;

/**
 *
 * @author MARTIN
 */
public class clientwin extends javax.swing.JFrame {
    int ev,ev2;
    int opm=0;
    int opc=0;
    int opcc=0;
    int it=0;
    int it2=0;
    int tablaCon=1;
    int contModE=0;
    int c1;
    int cantt=0;
    int dis=0;
    int cant=0; 
    int valc=0;
    String pru;
    String path;
    Cliente client = new Cliente();
    Boleto ticket = new Boleto();
    Evento evento = new Evento();
    Boleto [] carBoletos;
    String usr;
    Evento [] carEventos;
    Evento [] carEventos2;
    Evento eventoP;
    Boleto boletoP;
    ArrayList<Seccion> secciones=new ArrayList<Seccion>();
    /**
     * Creates new form clientwin
     */
    public clientwin(){
        
    }
    public clientwin(Cliente clientL) {
        
        initComponents();  
        this.setTitle("Cliente: "+clientL.getNomUsr());
        usr=clientL.getNomUsr();
        Image im = Toolkit.getDefaultToolkit().getImage("mega.png");
        this.setIconImage(im);
        Date fec=new Date();
        fec.setTime(System.currentTimeMillis());
        
        client=clientL;
        
        carBoletos=new Objetos().obtenerBoletos(usr);
        carEventos=new Objetos().obtenerEventosT();
        carEventos2=new Objetos().obtenerEventos();
        System.out.println(jComboBox4.getItemAt(0).toString());
        cargar();
        jTable1.setModel(new TablaEventoAdmin(carEventos));
        try{
            jTable2.setModel(new TablaBoletosCliente(carBoletos));
            
        }
        catch(Exception e){
            System.out.println(e.getMessage());
        }
        
        //Seleccion de un elemento de la tabla de eventos
       /*ListSelectionModel rowSM = jTable2.getSelectionModel();
        rowSM.addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
                    ListSelectionModel lsm = (ListSelectionModel)e.getSource();
                    if (lsm.isSelectionEmpty()) {
                        
                    } 
                    else {
                        int sR = lsm.getMinSelectionIndex();
                        TablaBoletosCliente TCC1 = (TablaBoletosCliente)jTable2.getModel();
                        Boleto[] c = TCC1.getArray();
                        System.out.println(c[sR].getClaveE());
                        for(it=0;it<carBoletos.length;it++){
                            if(carBoletos[it].getClaveE().equals(c[sR].getClaveE()))
                                break;
                        }                        
                       // System.out.println(carBoletos[it].getNomUsr() + usr);
                        jTextField3.setText(carBoletos[it].getClaveE());
                        jTextField18.setText(carBoletos[it].getClaveB());
                            /*jTextField3.setText(carBoletos[it].getNombre());
                            //jTextField14.setText(carBoletos[it].getSeccion());
                            //jTextField15.setText(carBoletos[it].getFila());
                            //jDateChooser2.setDate(carBoletos[it].getFecha());
                           
                                              
                    }                    
                }
            });  */    
            
        jComboBox3.addItem("1");
        jComboBox3.addItem("2");
        jComboBox3.addItem("3");
        jComboBox3.addItem("4");
        
        jComboBox1.setEnabled(false);
        //jComboBox2.setEnabled(false);
        jComboBox3.setEnabled(false);
        
        jTextField1.setEnabled(false);
        jTextField2.setEnabled(false);
        jTextField4.setEnabled(false);
        jTextField5.setEnabled(false);
        jTextField6.setEnabled(false);
        jTextField7.setEnabled(false);
        jDateChooser1.setEnabled(false);
        jButton3.setEnabled(false);
        jButton4.setEnabled(false);
        jTextField3.setEnabled(false);        
        jTextField14.setEnabled(false);
        jTextField15.setEnabled(false);
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jTextField2 = new javax.swing.JTextField();
        jTextField4 = new javax.swing.JTextField();
        jTextField5 = new javax.swing.JTextField();
        jTextField6 = new javax.swing.JTextField();
        jTextField7 = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jDateChooser1 = new com.toedter.calendar.JDateChooser();
        jButton3 = new javax.swing.JButton();
        jLabel11 = new javax.swing.JLabel();
        jTextField16 = new javax.swing.JTextField();
        jComboBox4 = new javax.swing.JComboBox();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jTextField17 = new javax.swing.JTextField();
        jPanel1 = new javax.swing.JPanel();
        jButton5 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        jPasswordField2 = new javax.swing.JPasswordField();
        jLabel26 = new javax.swing.JLabel();
        jPasswordField3 = new javax.swing.JPasswordField();
        jLabel27 = new javax.swing.JLabel();
        jPasswordField1 = new javax.swing.JPasswordField();
        jLabel10 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jTextField3 = new javax.swing.JTextField();
        jTextField14 = new javax.swing.JTextField();
        jTextField15 = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jDateChooser2 = new com.toedter.calendar.JDateChooser();
        jTextField18 = new javax.swing.JTextField();
        jTextField19 = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jTextField20 = new javax.swing.JTextField();
        jButton7 = new javax.swing.JButton();
        jLabel32 = new javax.swing.JLabel();
        jTextField10 = new javax.swing.JTextField();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jLabel12 = new javax.swing.JLabel();
        jTextField8 = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        jButton2 = new javax.swing.JButton();
        jLabel15 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jComboBox1 = new javax.swing.JComboBox();
        jTextField11 = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        jComboBox3 = new javax.swing.JComboBox();
        jLabel19 = new javax.swing.JLabel();
        jTextField12 = new javax.swing.JTextField();
        jButton4 = new javax.swing.JButton();
        jTextField13 = new javax.swing.JTextField();
        jLabel29 = new javax.swing.JLabel();
        jDateChooser3 = new com.toedter.calendar.JDateChooser();
        jLabel30 = new javax.swing.JLabel();
        jTextField21 = new javax.swing.JTextField();
        jTextField9 = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel31 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Cliente");
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
            public void windowClosed(java.awt.event.WindowEvent evt) {
                formWindowClosed(evt);
            }
        });

        jTabbedPane1.setToolTipText("Info Gral.");
        jTabbedPane1.setName("");
        jTabbedPane1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTabbedPane1MouseClicked(evt);
            }
        });

        jLabel1.setText("Nombre:");

        jTextField1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField1ActionPerformed(evt);
            }
        });

        jLabel2.setText("Apellido:");

        jLabel5.setText("Fecha de nacimiento:");

        jLabel6.setText("Dirección:");

        jLabel7.setText("Codigo Postal:");

        jLabel8.setText("e-mail:");

        jLabel9.setText("Teléfono:");

        jButton1.setText("Modificar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton3.setText("Guardar");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jLabel11.setText("No. Tarjeta:");

        jTextField16.setEnabled(false);

        jComboBox4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "VISA", "Mastercard", "American Express", "Discover", "Diners Club", "enRoute", "JCB", "Voyager" }));
        jComboBox4.setEnabled(false);
        jComboBox4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox4ActionPerformed(evt);
            }
        });

        jLabel24.setText("Tipo:");

        jLabel25.setText("Clave:");

        jTextField17.setEnabled(false);

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jButton5.setText("Modificar");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        jButton6.setText("Guardar");
        jButton6.setEnabled(false);
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        jPasswordField2.setEnabled(false);

        jLabel26.setText("Nueva Contraseña:");

        jPasswordField3.setEnabled(false);

        jLabel27.setText("Repetir Contraseña:");

        jPasswordField1.setEnabled(false);

        jLabel10.setText("Contraseña Anterior:");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel27)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPasswordField3, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel26)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPasswordField2)))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(40, 40, 40)
                        .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel10)
                        .addGap(59, 59, 59)))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton5)
                        .addComponent(jLabel26)
                        .addComponent(jPasswordField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLabel10, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton6)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel27)
                        .addComponent(jPasswordField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel7)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel9)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel8)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel2)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(56, 56, 56)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel25)
                            .addComponent(jLabel11)
                            .addComponent(jLabel24))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextField17, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextField16, javax.swing.GroupLayout.PREFERRED_SIZE, 187, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jDateChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(28, 28, 28)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel5)
                    .addComponent(jDateChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel6)
                            .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel8)
                            .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel9)
                            .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel11)
                            .addComponent(jTextField16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel24)
                            .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel25)
                            .addComponent(jTextField17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Info Perfil", jPanel2);

        jTable2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {"Metallicash", "01-08-12"},
                {"Megadeth", "19-09-12"}
            },
            new String [] {
                "Evento", "Fecha"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        jTable2.getTableHeader().setReorderingAllowed(false);
        jTable2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable2MouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(jTable2);
        jTable2.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);

        jLabel20.setText("Evento:");

        jLabel21.setText("Fecha:");

        jLabel22.setText("Seccion:");

        jLabel23.setText("Asientos");

        jLabel3.setText("Clave Boleto:");

        jDateChooser2.setEnabled(false);

        jTextField18.setEnabled(false);

        jTextField19.setEnabled(false);

        jLabel4.setText("Clave Evento:");

        jLabel28.setText("Foro:");

        jTextField20.setEnabled(false);

        jButton7.setText("Imprimir Boleto");
        jButton7.setEnabled(false);
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });

        jLabel32.setText("Fila:");

        jTextField10.setEnabled(false);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 244, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel32)
                            .addComponent(jLabel23))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextField15)
                            .addComponent(jTextField10)))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4)
                            .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel20, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel28, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel21, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel22, javax.swing.GroupLayout.Alignment.TRAILING))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jDateChooser2, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextField20, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)
                            .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(jTextField18, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE)
                                .addComponent(jTextField19, javax.swing.GroupLayout.Alignment.LEADING))
                            .addComponent(jTextField14)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addComponent(jButton7)
                        .addGap(48, 48, 48)))
                .addContainerGap(74, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addGap(0, 11, Short.MAX_VALUE)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 304, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(17, 17, 17)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel20)
                    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4))
                .addGap(8, 8, 8)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jTextField18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(5, 5, 5)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel28)
                    .addComponent(jTextField20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel21)
                    .addComponent(jDateChooser2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel22))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel32)
                    .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel23)
                    .addComponent(jTextField15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jButton7)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Mis Boletos", jPanel3);

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Clave", "Evento", "Fecha", "Ciudad"
            }
        ));
        jTable1.getTableHeader().setReorderingAllowed(false);
        jTable1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable1MouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(jTable1);
        jTable1.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);

        jLabel12.setText("Evento:");

        jTextField8.setEnabled(false);

        jLabel13.setText("Fecha:");

        jButton2.setText("Comprar");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jLabel15.setText("Seccion:");

        jLabel17.setText("Precio: $");

        jComboBox1.setToolTipText("");
        jComboBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox1ActionPerformed(evt);
            }
        });

        jTextField11.setEnabled(false);

        jLabel18.setText("Cantidad:");

        jComboBox3.setToolTipText("");
        jComboBox3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox3ActionPerformed(evt);
            }
        });

        jLabel19.setText("Total:");

        jTextField12.setEnabled(false);

        jButton4.setText("Realizar Compra");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jTextField13.setEnabled(false);

        jLabel29.setText("Foro:");

        jDateChooser3.setEnabled(false);

        jLabel30.setText("Clave Evento:");

        jTextField21.setEnabled(false);

        jTextField9.setEnabled(false);
        jTextField9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField9ActionPerformed(evt);
            }
        });

        jLabel16.setText("Disponibilidad:");

        jLabel14.setText("d");

        jLabel31.setText("jLabel31");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 244, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addComponent(jLabel12)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addComponent(jLabel29)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addComponent(jLabel15)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addComponent(jLabel17)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addComponent(jLabel16)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addComponent(jLabel19)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextField12))
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jButton4)
                                            .addGroup(jPanel4Layout.createSequentialGroup()
                                                .addComponent(jLabel18)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                        .addGap(2, 2, 2))))
                            .addComponent(jButton2)
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addComponent(jLabel30)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField21, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addComponent(jLabel13)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jDateChooser3, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(30, 30, 30)
                        .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(55, 55, 55)
                        .addComponent(jLabel31)))
                .addContainerGap(62, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 318, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel12)
                            .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel13)
                            .addComponent(jDateChooser3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel29)
                            .addComponent(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextField21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel30))
                        .addGap(18, 18, 18)
                        .addComponent(jButton2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel15)
                            .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel18)
                            .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel19)
                                .addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel16)))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel17)
                            .addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton4))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel31))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Buscar Evento", jPanel4);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(20, Short.MAX_VALUE)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 343, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
               
        if(contModE==0){
            if(tablaCon==1){
                int k=jComboBox1.getSelectedIndex();
                if(k>=0){
                    //jTextField16.setText(evento.getSecEvt()[k].getNomSec());
                    jTextField9.setText(""+evento.getSecEvt()[k].getCantSec());
                    dis=evento.getSecEvt()[k].getCantSec();                    
                    jTextField11.setText(""+evento.getSecEvt()[k].getCostSec());
                    if(jComboBox3.getSelectedIndex()==0){
                        jTextField12.setText("$" + jTextField11.getText());
                        cant=1;
                    }
                    if(jComboBox3.getSelectedIndex()==1){
                            c1= Integer.parseInt(jTextField11.getText());
                            c1=c1*2;                
                            jTextField12.setText("$" + Integer.toString(c1));
                            cant=2;
                    }
                    if(jComboBox3.getSelectedIndex()==2){
                            c1= Integer.parseInt(jTextField11.getText()); 
                            c1=c1*3;                
                            jTextField12.setText("$" + Integer.toString(c1));
                            cant=3;
                    }
                    if(jComboBox3.getSelectedIndex()==3){
                            c1= Integer.parseInt(jTextField11.getText());
                            c1=c1*4;                
                            jTextField12.setText("$" + Integer.toString(c1));
                            cant=4;
                    }
                    System.out.println(dis + "-" + cant + "=" + (dis-cant));
                    if((dis-cant)<0){
                        jLabel14.setText("");
                        path="tache.gif";
                        URL url = this.getClass().getResource(path);  
                        ImageIcon icon = new ImageIcon(url);  
                        Icon icono = new ImageIcon(icon.getImage().getScaledInstance(jLabel14.getWidth(), jLabel14.getHeight(), Image.SCALE_DEFAULT));
         
                        jLabel14.setIcon(icono);                        
                        jButton4.setEnabled(false);
                    }else{
                        jLabel14.setText("");
                        path="palomita.jpg";
                        URL url = this.getClass().getResource(path);  
                        ImageIcon icon = new ImageIcon(url);  
                        Icon icono = new ImageIcon(icon.getImage().getScaledInstance(jLabel14.getWidth(), jLabel14.getHeight(), Image.SCALE_DEFAULT));
         
                        jLabel14.setIcon(icono); 
                        if(valc==1){
                          jButton4.setEnabled(true);  
                        }
                        
                    }
                }
            }
        }
        else{
            int k=jComboBox1.getSelectedIndex();
            if(k>=0){
                //jTextField16.setText(secciones.get(k).getNomSec());
                jTextField9.setText(""+secciones.get(k).getCantSec());
                jTextField11.setText(""+secciones.get(k).getCostSec());
                    if(jComboBox3.getSelectedIndex()==0){
                        jTextField12.setText("$" + jTextField11.getText());
                        cant=1;
                    }
                    if(jComboBox3.getSelectedIndex()==1){
                            c1= Integer.parseInt(jTextField11.getText());
                            c1=c1*2;                
                            jTextField12.setText("$" + Integer.toString(c1));
                            cant=2;
                    }
                    if(jComboBox3.getSelectedIndex()==2){
                            c1= Integer.parseInt(jTextField11.getText()); 
                            c1=c1*3;                
                            jTextField12.setText("$" + Integer.toString(c1));
                            cant=3;
                    }
                    if(jComboBox3.getSelectedIndex()==3){
                            c1= Integer.parseInt(jTextField11.getText());
                            c1=c1*4;                
                            jTextField12.setText("$" + Integer.toString(c1));
                            cant=4;
                    }
            }
        }
    }//GEN-LAST:event_jComboBox1ActionPerformed

    private void jComboBox3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox3ActionPerformed
        
        
       if(jComboBox3.getSelectedIndex()==0){
            jTextField12.setText("$" + jTextField11.getText());
            cant=1;
       }
       if(jComboBox3.getSelectedIndex()==1){
            c1= Integer.parseInt(jTextField11.getText());
            c1=c1*2;                
            jTextField12.setText("$" + Integer.toString(c1));
            cant=2;
        }
        if(jComboBox3.getSelectedIndex()==2){
            c1= Integer.parseInt(jTextField11.getText()); 
            c1=c1*3;                
            jTextField12.setText("$" + Integer.toString(c1));
            cant=3;
        }
        if(jComboBox3.getSelectedIndex()==3){
            c1= Integer.parseInt(jTextField11.getText());
            c1=c1*4;                
            jTextField12.setText("$" + Integer.toString(c1));
           cant=4;
        }
        System.out.println(dis + "-" + cant + "=" + (dis-cant));
        if((dis-cant)<0){
                jLabel14.setText("");
                path="tache.gif";
                URL url = this.getClass().getResource(path);  
                ImageIcon icon = new ImageIcon(url);  
                Icon icono = new ImageIcon(icon.getImage().getScaledInstance(jLabel14.getWidth(), jLabel14.getHeight(), Image.SCALE_DEFAULT));

                jLabel14.setIcon(icono); 
                jButton4.setEnabled(false);
            }else{
                jLabel14.setText("");
                path="palomita.jpg";
                URL url = this.getClass().getResource(path);  
                ImageIcon icon = new ImageIcon(url);  
                Icon icono = new ImageIcon(icon.getImage().getScaledInstance(jLabel14.getWidth(), jLabel14.getHeight(), Image.SCALE_DEFAULT));

                jLabel14.setIcon(icono); 
                if(valc==1){
                   jButton4.setEnabled(true);  
                }
            }
    }//GEN-LAST:event_jComboBox3ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        
        opm++;
        if(opm==1){
            Habilitarinfo();
            jButton1.setText("Cancelar");
                       
        }
        if(opm==2){
            Deshabilitarinfo();
            jButton1.setText("Modificar");
            cargar();
            opm=0;
        }
        
        
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        opc++;
        valc++;
        if(opc==1){
            Habilitarcompra();
            jButton2.setText("Cancelar");
            if((dis-cant)<0){
                jLabel14.setText("");
                path="tache.gif";
                URL url = this.getClass().getResource(path);  
                ImageIcon icon = new ImageIcon(url);  
                Icon icono = new ImageIcon(icon.getImage().getScaledInstance(jLabel14.getWidth(), jLabel14.getHeight(), Image.SCALE_DEFAULT));

                jLabel14.setIcon(icono); 
                jButton4.setEnabled(false);
            }else{
                jLabel14.setText("");
                path="palomita.jpg";
                URL url = this.getClass().getResource(path);  
                ImageIcon icon = new ImageIcon(url);  
                Icon icono = new ImageIcon(icon.getImage().getScaledInstance(jLabel14.getWidth(), jLabel14.getHeight(), Image.SCALE_DEFAULT));

                jLabel14.setIcon(icono); 
                jButton4.setEnabled(true);
            }
        }
        if (opc==2){
            Deshabilitarcompra();
            jButton2.setText("Comprar");
            opc=0;
            valc=0;
        }
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
        
    }//GEN-LAST:event_jTextField1ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        int v=0;
        Validacion val = new Validacion();
        System.out.println(val.validarinfo(jTextField1.getText()));
        
        if(val.validarinfo(jTextField1.getText())==0){
            //client.setNombre(jTextField1.getText());
        }else{
            JOptionPane.showMessageDialog(null, "Caracter invalido en el nombre","Error",0);
            v++;
        } 
        
        if(val.validarinfo(jTextField2.getText())==0){
            //client.setApellido(jTextField2.getText());
        }else{
            JOptionPane.showMessageDialog(null, "Caracter invalido en el Apellido","Error",0);
            v++;
        } 
        
        //client.setfecNac(jDateChooser1.getDate());
        
        if(val.validarinfo(jTextField4.getText())==0){
            //client.setDireccion(jTextField4.getText());
        }else{
            JOptionPane.showMessageDialog(null, "Caracter invalido en la direccion","Error",0);
            v++;
        }   
        
        if(val.validarinfo(jTextField5.getText())==0){
            //client.setCP(jTextField5.getText());
        }else{
            JOptionPane.showMessageDialog(null, "Caracter invalido en el CP","Error",0);
            v++;
        }
        
        if(val.validarcorreo(jTextField6.getText())==0){
            //client.setemail(jTextField6.getText());
        }else{
            JOptionPane.showMessageDialog(null, "Caracter invalido en el correo","Error",0);
            v++;
        }
        
        if(val.validarinfo(jTextField7.getText())==0){
           //client.setTelefono(jTextField7.getText());
        }else{
            JOptionPane.showMessageDialog(null, "Caracter invalido en el telefono","Error",0);
            v++;
        }
        
        if(val.validarinfo(jTextField16.getText())==0){
           //client.setCodTarjeta(jTextField16.getText());
        }else{
            JOptionPane.showMessageDialog(null, "Caracter invalido en el num. de la tarjeta","Error",0);
            v++;
        }
        
        //client.setTTarjeta(jComboBox4.getSelectedObjects().toString());
        
        if(val.validarinfo(jTextField17.getText())==0){
           //client.setCodigo(jTextField17.getText());
        }else{
            JOptionPane.showMessageDialog(null, "Caracter invalido en el codigo de la tarjeta","Error",0);
            v++;
        } 
        if(v==0){
            client.setNombre(jTextField1.getText());        
            client.setApellido(jTextField2.getText());
            client.setfecNac(jDateChooser1.getDate());
            client.setDireccion(jTextField4.getText());
            client.setCP(jTextField5.getText());
            client.setemail(jTextField6.getText());
            client.setTelefono(jTextField7.getText());
            client.setCodTarjeta(jTextField16.getText());
            client.setTTarjeta(jComboBox4.getSelectedItem().toString());
            client.setCodigo(jTextField17.getText());
            Conexion con = new Conexion();            
            System.out.println(con.modificarCliente(client));
            Deshabilitarinfo();
            jButton1.setText("Modificar");
            opm=0;
            JOptionPane.showMessageDialog(null, "Información guardada", "Notificacion", 1);
        }
        
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jTable2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable2MouseClicked
                
        it=jTable2.getSelectedRow();
        jButton7.setEnabled(true);
        ticket=carBoletos[it];
        boletoP=ticket;
        for(int i=0; i<carEventos2.length;i++){
            if(carBoletos[it].getClaveE().equals(carEventos2[i].getClave())){
                eventoP=carEventos2[i];
                jTextField3.setText(carEventos2[i].getNombre());
                jTextField20.setText(carEventos2[i].getForo());
                jDateChooser2.setDate(carEventos2[i].getFecha());
                break;
            }
        }
        jTextField14.setText(carBoletos[it].getSeccion());
        jTextField15.setText(carBoletos[it].getAsiento());
        jTextField19.setText(carBoletos[it].getClaveE());
        jTextField10.setText(carBoletos[it].getFila());
        jTextField18.setText(carBoletos[it].getClaveB());
        /*int prub2;
        ListSelectionModel rowSM32 = jTable2.getSelectionModel();
        ev2=rowSM32.getAnchorSelectionIndex();
        System.out.println(ev2);
        if(ev2==0){
            prub2=jComboBox1.getSelectedIndex();
            jTextField3.setText("Metallicash");
            //jTextField13.setText("01-08-12");
            jTextField14.setText("General Pista");
            jTextField15.setText("1,2");
            
                        
        }
        if(ev2==1){
            prub2=jComboBox1.getSelectedIndex();
            jTextField3.setText("Megadeth");
            //jTextField13.setText("19-09-12");
            jTextField14.setText("General A");
            jTextField15.setText("A,B");
            
        }*/
    }//GEN-LAST:event_jTable2MouseClicked

    private void jComboBox4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox4ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jComboBox4ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        opcc++;
        if(opcc==1){
            Habilitarpass();
            jButton5.setText("Cancelar");
        }
        if (opcc==2){
            Deshabilitarpass();
            jButton5.setText("Cambiar");
            opcc=0;
        }
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        String comp="";
        String comp2="";
        String pass="";
        
        for(int i=0;i<jPasswordField1.getPassword().length;i++){
            pass+=jPasswordField1.getPassword()[i];
        }
        System.out.println(client.getPass() + " " +pass);
        if((client.getPass()).equals(pass) ){
            for(int d=0;d<jPasswordField2.getPassword().length;d++){
                comp+=jPasswordField2.getPassword()[d];
            } 
            for(int d=0;d<jPasswordField3.getPassword().length;d++){
                comp2+=jPasswordField3.getPassword()[d];
            }
            if(comp.equals(comp2)){
                client.setPass(comp);
                Conexion con = new Conexion();            
                System.out.println(con.modificarCliente(client));
                Deshabilitarpass();
                jButton5.setText("Cambiar");
                opcc=0;
                JOptionPane.showMessageDialog(null, "Contraseña guardada", "Notificacion", 1);
            }else{
                JOptionPane.showMessageDialog(null, "Las contraseñas no coinciden, escribalas de nuevo","Alerta",2);
            }
        }else{
            JOptionPane.showMessageDialog(null, "La contraseña anterior es incorrecta","Error",0);
        }
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jTabbedPane1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTabbedPane1MouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_jTabbedPane1MouseClicked

    private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1MouseClicked

        it2 = jTable1.getSelectedRow();
        evento = carEventos[it2];
        jTextField8.setText(carEventos[it2].getNombre());
        jDateChooser3.setDate(carEventos[it2].getFecha());
        jTextField13.setText(carEventos[it2].getForo());
        jTextField21.setText(carEventos[it2].getClave());
        jComboBox1.removeAllItems();
        for (int i = 0; i < carEventos[it2].getSecEvt().length; i++) {
            jComboBox1.addItem(carEventos[it2].getSecEvt()[i].getNomSec());
        }
        /*
         * int prub; ListSelectionModel rowSM3 = jTable1.getSelectionModel();
         * ev=rowSM3.getAnchorSelectionIndex(); System.out.println(ev);
         * if(ev==0){ prub=jComboBox1.getSelectedIndex();
         * jTextField8.setText("Metallicash"); jTextField9.setText("01-08-12");
         * jTextField10.setText("Agotados"); jComboBox1.removeAllItems();
         * jComboBox1.addItem(""); jComboBox1.addItem("General Pista");
         * jComboBox1.addItem("Seccion D"); jComboBox1.addItem("General Alta");
         *
         * jComboBox2.removeAllItems(); jComboBox2.addItem("");
         * jComboBox2.addItem("1"); jComboBox2.addItem("2");
         * jComboBox2.addItem("3");
         *
         * }
         * if(ev==1){ prub=jComboBox1.getSelectedIndex();
         * jTextField8.setText("Megadeth"); jTextField9.setText("19-09-12");
         * jTextField10.setText("Disponibles"); jComboBox1.removeAllItems();
         * jComboBox1.addItem(""); jComboBox1.addItem("General A");
         * jComboBox1.addItem("Seccion B"); jComboBox1.addItem("General C");
         *
         * jComboBox2.removeAllItems(); jComboBox2.addItem("");
         * jComboBox2.addItem("A"); jComboBox2.addItem("B");
         * jComboBox2.addItem("C");
         *
         * }
         */
    }//GEN-LAST:event_jTable1MouseClicked

    private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
        // TODO add your handling code here:
        
    }//GEN-LAST:event_formWindowClosed

    private void jTextField9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField9ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField9ActionPerformed

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        // TODO add your handling code here:
        cerrarSesion();
    }//GEN-LAST:event_formWindowClosing

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        // TODO add your handling code here:
        Boleto [] compraBoletos=new Boleto[cant];
        int not=0;
        int k=1;
        Boleto [] validarCB=new Objetos().obtenerBoletos(usr);
        for(k=0;k<validarCB.length;k++){
            if(validarCB[k].getClaveE().equals(carEventos[it2].getClave())){
                k=0;
                break;
            }
        }
        if(k==0 && validarCB.length>0){
            JOptionPane.showMessageDialog(null, "Ya has comprado boletos para este evento", "Advertencia", 2);
        }
        else{
            for(int i=0;i<cant;i++){
                    compraBoletos[i]=new Objetos().generarBoleto(carEventos[it2],jComboBox1.getSelectedItem().toString(),usr);
                    not+=new Conexion().enviarBoleto(compraBoletos[i]);

            }
            if(not==compraBoletos.length){
                    //Mandar mensaje de confirmacion
                JOptionPane.showMessageDialog(null, "Compra realizada", "Notificacion", 1);
                cargar();
                Deshabilitarcompra();
                jButton2.setText("Comprar");
                opc=0;
                valc=0;
            }
        }

    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
        // TODO add your handling code here:
        try{
            Impresora imprimir=new Impresora(usr);
            imprimir.imprimir(eventoP, boletoP);
            
        }
        catch(Exception e){
            JOptionPane.showMessageDialog(null, "No se pudo imprimir", "Error", 0);
        }
    }//GEN-LAST:event_jButton7ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(clientwin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(clientwin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(clientwin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(clientwin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        
        try{
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        }catch(Exception e){
            e.printStackTrace();
        }
        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new clientwin().setVisible(true);
            }
        });
    }
    public void cargar(){
        jTextField1.setText(client.getNombre());
        jTextField2.setText(client.getApellido());
        jDateChooser1.setDate(client.getfecNac());
        jTextField4.setText(client.getDireccion());
        jTextField5.setText(client.getCP());
        jTextField6.setText(client.getemail());
        jTextField7.setText(client.getTelefono());
        jTextField16.setText(client.getCodTarjeta());
        
        if(client.getTTarjeta().equals(jComboBox4.getItemAt(0).toString())){
            jComboBox4.setSelectedIndex(0);
        }else if(client.getTTarjeta().equals(jComboBox4.getItemAt(1).toString())){
            jComboBox4.setSelectedIndex(1);
        }else if(client.getTTarjeta().equals(jComboBox4.getItemAt(2).toString())){
            jComboBox4.setSelectedIndex(2);
        }else if(client.getTTarjeta().equals(jComboBox4.getItemAt(3).toString())){
            jComboBox4.setSelectedIndex(3);
        }else if(client.getTTarjeta().equals(jComboBox4.getItemAt(4).toString())){
            jComboBox4.setSelectedIndex(4);
        }else if(client.getTTarjeta().equals(jComboBox4.getItemAt(5).toString())){
            jComboBox4.setSelectedIndex(5);
        }else if(client.getTTarjeta().equals(jComboBox4.getItemAt(6).toString())){
            jComboBox4.setSelectedIndex(6);
        }else if(client.getTTarjeta().equals(jComboBox4.getItemAt(7).toString())){
            jComboBox4.setSelectedIndex(7);
        }
        carBoletos=new Objetos().obtenerBoletos(usr);
        carEventos=new Objetos().obtenerEventosT();
        jTextField17.setText(client.getCodigo());    
        jTable1.setModel(new TablaEventoAdmin(carEventos));
        try{
            jTable2.setModel(new TablaBoletosCliente(carBoletos));
            
        }
        catch(Exception e){
            System.out.println(e.getMessage());
            //jTable2.setModel(new TablaBoletosCliente());
        }
    }
    public void Habilitarinfo(){
        jTextField1.setEnabled(true);
        jTextField2.setEnabled(true);
        jTextField4.setEnabled(true);
        jTextField5.setEnabled(true);
        jTextField6.setEnabled(true);
        jTextField7.setEnabled(true);
        jDateChooser1.setEnabled(true);            
        jButton3.setEnabled(true);
        jTextField16.setEnabled(true);
        jTextField17.setEnabled(true);
        jComboBox4.setEnabled(true);
    }
    public void Deshabilitarinfo(){
        jTextField1.setEnabled(false);
        jTextField2.setEnabled(false);
        jTextField4.setEnabled(false);
        jTextField5.setEnabled(false);
        jTextField6.setEnabled(false);
        jTextField7.setEnabled(false);
        jDateChooser1.setEnabled(false);
        jButton3.setEnabled(false);
        jTextField16.setEnabled(false);
        jTextField17.setEnabled(false);
        jComboBox4.setEnabled(false);
        
    }
    public void Habilitarcompra(){
        jComboBox1.setEnabled(true);
        //jComboBox2.setEnabled(true);
        jComboBox3.setEnabled(true);
        jButton4.setEnabled(true);
    }
    public void Deshabilitarcompra(){
        jComboBox1.setEnabled(false);
        //jComboBox2.setEnabled(false);
        jComboBox3.setEnabled(false);
        jButton4.setEnabled(false);
    }
    public void Habilitarpass(){
        jPasswordField1.setEnabled(true);
        jPasswordField2.setEnabled(true);
        jPasswordField3.setEnabled(true);
        jButton6.setEnabled(true);
    }
    public void Deshabilitarpass(){
        jPasswordField1.setEnabled(false);
        jPasswordField2.setEnabled(false);
        jPasswordField3.setEnabled(false);
        jPasswordField1.setText("");
        jPasswordField2.setText("");
        jPasswordField3.setText("");
        jButton6.setEnabled(false);
    }
    public void cerrarSesion(){
    	if(JOptionPane.showConfirmDialog(this, "¿Desea cerrar sesión?", "Cerrar Sesión", JOptionPane.YES_NO_OPTION)==0)
    	{
    		setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    		new loginwin().setVisible(true);
    	}	
    	else
    		setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox3;
    private javax.swing.JComboBox jComboBox4;
    private com.toedter.calendar.JDateChooser jDateChooser1;
    private com.toedter.calendar.JDateChooser jDateChooser2;
    private com.toedter.calendar.JDateChooser jDateChooser3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPasswordField jPasswordField1;
    private javax.swing.JPasswordField jPasswordField2;
    private javax.swing.JPasswordField jPasswordField3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTable2;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField10;
    private javax.swing.JTextField jTextField11;
    private javax.swing.JTextField jTextField12;
    private javax.swing.JTextField jTextField13;
    private javax.swing.JTextField jTextField14;
    private javax.swing.JTextField jTextField15;
    private javax.swing.JTextField jTextField16;
    private javax.swing.JTextField jTextField17;
    private javax.swing.JTextField jTextField18;
    private javax.swing.JTextField jTextField19;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField20;
    private javax.swing.JTextField jTextField21;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTextField jTextField5;
    private javax.swing.JTextField jTextField6;
    private javax.swing.JTextField jTextField7;
    private javax.swing.JTextField jTextField8;
    private javax.swing.JTextField jTextField9;
    // End of variables declaration//GEN-END:variables
}
